//
//  HMViewController.m
//  HMSlider
//
//  Created by Holin on 04/01/2015.
//  Copyright (c) 2014 Holin. All rights reserved.
//

#import "HMViewController.h"
#import "HMSlider.h"

@interface HMViewController () <HMSliderDelegate>
@property (weak, nonatomic) IBOutlet HMSlider *slider;

@end

@implementation HMViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
    NSArray *imageNames = @[@"image1.jpg", @"image2.jpg", @"image3.jpg", @"image4.jpg", @"image5.jpg", @"image6.jpg"];
    NSMutableArray *images = [NSMutableArray new];
    
    [imageNames enumerateObjectsUsingBlock:^(NSString *imageName, NSUInteger idx, BOOL *stop) {
        [images addObject:[UIImage imageNamed:imageName]];
    }];
    
    [_slider initWithImages:images];
    _slider.sliderDelegate = self;
    
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

# pragma mark - HMSliderDelegate
- (void)tapedAtIndex:(NSInteger)index {
    NSLog(@"Taped at index: %d", (int)index);
}

@end
